/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jili.ubert.code.server2client;

import com.baidu.bjf.remoting.protobuf.Codec;
import com.baidu.bjf.remoting.protobuf.ProtobufProxy;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import java.io.IOException;
import java.util.List;

/**
 *
 * @author ChengJiLi
 */
public class MsgResultList {
    @Protobuf
    private boolean success;
    @Protobuf
    public int returnID;
    @Protobuf
    private byte[] bitword;
    @Protobuf
    private byte[] bitremark;
    @Protobuf
    private List<MsgResult> basketOrderCheckRST;
    public MsgResultList(){}
    public MsgResultList(MsgResult rst){
        this.success=rst.getSuccess();
        this.returnID=rst.getReturnID();
        this.bitword=rst.getBitword();
        this.bitremark=rst.getBitremark();
    }
    public MsgResultList(boolean success,int returnID,String word){
        this.success=success;
        this.returnID=returnID;
        this.bitword=word.getBytes();
    }
    public void setSuccess(boolean success){
        this.success = success;
    }
    public boolean getSuccess(){
        return isSuccess();
    }
    public void setReturnID(int returnID){
        this.returnID = returnID;
    }
    public int getReturnID(){
        return returnID;
    }
    public void setWord(String word){
        this.setBitword(word.getBytes());
    }
    public String getWord(){
        return new String(getBitword());
    }
    public static byte[] EnCode(MsgResultList msg) throws IOException{
        Codec<MsgResultList> Lcode = ProtobufProxy.create(MsgResultList.class);
        return Lcode.encode(msg);
    }
    public static MsgResultList DeCode(byte[] data) throws IOException{
        Codec<MsgResultList> Lcode = ProtobufProxy.create(MsgResultList.class);
        return Lcode.decode(data);
        
    }

    /**
     * @return the bitword
     */
    public byte[] getBitword() {
        return bitword;
    }


    /**
     * @return the remark
     */
    public String getRemark() {
        return new String(bitremark);
    }

    /**
     * @return the bitremark
     */
    public byte[] getBitremark() {
        return bitremark;
    }


    /**
     * @return the success
     */
    public boolean isSuccess() {
        return success;
    }

    /**
     * @param bitword the bitword to set
     */
    public void setBitword(byte[] bitword) {
        this.bitword = bitword;
    }

    /**
     * @param bitremark the bitremark to set
     */
    public void setBitremark(byte[] bitremark) {
        this.bitremark = bitremark;
    }

    /**
     * @return the basketOrderCheckRST
     */
    public List<MsgResult> getBasketOrderCheckRST() {
        return basketOrderCheckRST;
    }

    /**
     * @param basketOrderCheckRST the basketOrderCheckRST to set
     */
    public void setBasketOrderCheckRST(List<MsgResult> basketOrderCheckRST) {
        this.basketOrderCheckRST = basketOrderCheckRST;
    }
}
